import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
  },
  {
    path: '/login',
    name: 'login',
    component: () =>
      import(/* webpackChunkName: "about" */ '../views/LoginView.vue'),
  },
  {
    path: '/cart',
    name: 'cart',
    component: () => import('@/components/cart/CartView.vue'),
  },
  {
    path: '/about1',
    name: 'about1',
    component: () => import('../views/AboutView1.vue'),
  },
  {
    path: '/about2',
    name: 'about2',
    component: () => import('../views/AboutView2.vue'),
  },
  {
    path: "/personal",
    name: "personal",
    component: () => import("../views/PersonalView.vue"),
  },{
    path:"/particulars/:id",
    name:"particulars",
    component: ()=>import('../views/particulars/ParticularsView')
  }
]

const router = new VueRouter({
  routes,
})

export default router
